inherited sprLotery: TsprLotery
  Left = 329
  Top = 175
  Height = 629
  Caption = #1057#1087#1088#1072#1074#1086#1095#1085#1080#1082' '#1083#1086#1090#1077#1088#1077#1081
  PixelsPerInch = 96
  TextHeight = 13
  inherited pStatusBar: TStatusBar
    Top = 583
  end
  inherited Panel2: TPanel
    Top = 25
    Height = 558
    inherited PageControl1: TPageControl
      Height = 558
      inherited tsTab: TTabSheet
        inherited GroupBox3: TGroupBox
          Height = 530
          inherited dbgRefer: TDBGridEh
            Height = 513
            Columns = <
              item
                EditButtons = <>
                FieldName = 'LOT_ID'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'MIN_PAY_SUMMA'
                Footers = <>
                Width = 124
              end
              item
                EditButtons = <>
                FieldName = 'MIN_AFTER_SALDO'
                Footers = <>
                Width = 121
              end
              item
                EditButtons = <>
                FieldName = 'BDATE'
                Footers = <>
                Width = 107
              end
              item
                EditButtons = <>
                FieldName = 'EDATE'
                Footers = <>
                Width = 106
              end
              item
                EditButtons = <>
                FieldName = 'ETIME'
                Footers = <>
                Width = 110
              end>
          end
        end
      end
      inherited tsForm: TTabSheet
        inherited GroupBox2: TGroupBox
          Top = 0
          Width = 784
          Height = 530
          Align = alClient
          Constraints.MinHeight = 450
          Constraints.MinWidth = 750
          object Label1: TLabel [0]
            Left = 12
            Top = 30
            Width = 109
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            Caption = #8470' '#1083#1086#1090#1077#1088#1077#1080' ('#1048#1044')'
          end
          object Label2: TLabel [1]
            Left = 12
            Top = 51
            Width = 109
            Height = 25
            Alignment = taRightJustify
            AutoSize = False
            Caption = #1052#1080#1085#1080#1084#1072#1083#1100#1085#1072#1103' '#1089#1091#1084#1084#1072' '#1087#1083#1072#1090#1077#1078#1072
            WordWrap = True
          end
          object Label3: TLabel [2]
            Left = 12
            Top = 80
            Width = 109
            Height = 25
            Alignment = taRightJustify
            AutoSize = False
            Caption = #1052#1080#1085#1080#1084#1072#1083#1100#1085#1086#1077' '#1089#1072#1083#1100#1076#1086' '#1087#1086#1089#1083#1077' '#1086#1087#1083#1072#1090#1099
            WordWrap = True
          end
          object Label4: TLabel [3]
            Left = 12
            Top = 114
            Width = 109
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            Caption = #1044#1072#1090#1072' '#1085#1072#1095#1072#1083#1072
          end
          object Label5: TLabel [4]
            Left = 12
            Top = 142
            Width = 109
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            Caption = #1044#1072#1090#1072' '#1086#1082#1086#1085#1095#1072#1085#1080#1103
          end
          object Label6: TLabel [5]
            Left = 12
            Top = 170
            Width = 109
            Height = 13
            Alignment = taRightJustify
            AutoSize = False
            Caption = #1042#1088#1077#1084#1103' '#1086#1082#1086#1085#1095#1072#1085#1080#1103
          end
          object Label7: TLabel [6]
            Left = 12
            Top = 192
            Width = 109
            Height = 45
            Alignment = taRightJustify
            AutoSize = False
            Caption = #1054#1073#1088#1072#1090#1085#1072#1103' '#1074#1077#1088#1086#1103#1090#1085#1086#1089#1090#1100' '#1074#1099#1080#1075#1088#1099#1096#1072
            WordWrap = True
          end
          object Label8: TLabel [7]
            Left = 12
            Top = 236
            Width = 237
            Height = 45
            Alignment = taRightJustify
            AutoSize = False
            Caption = 
              #1057#1095#1080#1090#1072#1077#1090#1089#1103' '#1082#1072#1082' '#1082#1086#1083'-'#1074#1086' '#1086#1087#1083#1072#1095#1077#1085#1085#1099#1093' '#1095#1077#1082#1086#1074' '#1087#1088#1086#1096#1083#1086#1084' '#1084#1077#1089#1103#1094#1077', '#1074' '#1086#1088#1075#1072#1085#1080#1079#1072 +
              #1094#1080#1103#1093'-'#1091#1095#1072#1089#1090#1085#1080#1082#1072#1093
            WordWrap = True
          end
          inherited pnlButtons: TPanel
            Top = 497
            Width = 780
            inherited SpeedButton1: TSpeedButton
              Left = 581
            end
            inherited SpeedButton2: TSpeedButton
              Left = 683
            end
          end
          object dbeID: TDBEditEh
            Left = 128
            Top = 28
            Width = 121
            Height = 19
            AlwaysShowBorder = True
            DataField = 'LOT_ID'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 1
            Visible = True
          end
          object dbeMIN_PAY_SUMMA: TDBEditEh
            Left = 128
            Top = 56
            Width = 121
            Height = 19
            AlwaysShowBorder = True
            DataField = 'MIN_PAY_SUMMA'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 2
            Visible = True
          end
          object dbeMIN_AFTER_SALDO: TDBEditEh
            Left = 128
            Top = 84
            Width = 121
            Height = 19
            AlwaysShowBorder = True
            DataField = 'MIN_AFTER_SALDO'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 3
            Visible = True
          end
          object dbtBdate: TDBDateTimeEditEh
            Left = 128
            Top = 112
            Width = 121
            Height = 19
            AlwaysShowBorder = True
            DataField = 'BDATE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            Kind = dtkDateEh
            TabOrder = 4
            Visible = True
          end
          object dbtEdate: TDBDateTimeEditEh
            Left = 128
            Top = 140
            Width = 121
            Height = 19
            AlwaysShowBorder = True
            DataField = 'EDATE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            Kind = dtkDateEh
            TabOrder = 5
            Visible = True
          end
          object dbtETime: TDBDateTimeEditEh
            Left = 128
            Top = 168
            Width = 121
            Height = 19
            AlwaysShowBorder = True
            DataField = 'ETIME'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 6
            Visible = True
            EditFormat = 'HH:NN'
          end
          object Panel1: TPanel
            Left = 264
            Top = 15
            Width = 518
            Height = 482
            Align = alRight
            Anchors = [akLeft, akTop, akRight, akBottom]
            BevelOuter = bvNone
            TabOrder = 7
            object Splitter: TSplitter
              Left = 0
              Top = 184
              Width = 518
              Height = 3
              Cursor = crVSplit
              Align = alTop
              MinSize = 150
            end
            object GroupBox4: TGroupBox
              Left = 0
              Top = 187
              Width = 518
              Height = 295
              Align = alClient
              Caption = ' '#1057#1087#1080#1089#1086#1082' '#1086#1088#1075#1072#1085#1080#1079#1072#1094#1080#1081'-'#1091#1095#1072#1089#1090#1085#1080#1094' '
              TabOrder = 0
              object ToolBar3: TToolBar
                Left = 2
                Top = 15
                Width = 514
                Height = 25
                ButtonWidth = 24
                Caption = 'ToolBar1'
                EdgeBorders = []
                Flat = True
                Images = MAIN.ImageList
                TabOrder = 0
                object ToolButton20: TToolButton
                  Left = 0
                  Top = 0
                  Action = aOrgAdd
                end
                object ToolButton26: TToolButton
                  Left = 24
                  Top = 0
                  Width = 8
                  Caption = 'ToolButton6'
                  ImageIndex = 6
                  Style = tbsSeparator
                end
                object ToolButton27: TToolButton
                  Left = 32
                  Top = 0
                  Action = aOrgDelete
                end
                object ToolButton22: TToolButton
                  Left = 56
                  Top = 0
                  Width = 8
                  Caption = 'ToolButton4'
                  ImageIndex = 8
                  Style = tbsSeparator
                end
                object ToolButton23: TToolButton
                  Left = 64
                  Top = 0
                  Action = aOrgCommit
                end
                object ToolButton24: TToolButton
                  Left = 88
                  Top = 0
                  Action = aOrgRollback
                end
                object ToolButton25: TToolButton
                  Left = 112
                  Top = 0
                  Action = aOrgRefresh
                end
              end
              object dbgOrgs: TDBGridEh
                Left = 2
                Top = 40
                Width = 514
                Height = 228
                Align = alClient
                AllowedOperations = [alopInsertEh, alopDeleteEh, alopAppendEh]
                ColumnDefValues.Title.TitleButton = True
                DataSource = dscOrgs
                Flat = True
                FooterColor = clWindow
                FooterFont.Charset = DEFAULT_CHARSET
                FooterFont.Color = clWindowText
                FooterFont.Height = -11
                FooterFont.Name = 'MS Sans Serif'
                FooterFont.Style = []
                OddRowColor = clWindow
                Options = [dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgAlwaysShowSelection, dgConfirmDelete]
                OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghAutoSortMarking, dghMultiSortMarking, dghDblClickOptimizeColWidth, dghDialogFind]
                SortLocal = True
                TabOrder = 1
                TitleFont.Charset = DEFAULT_CHARSET
                TitleFont.Color = clWindowText
                TitleFont.Height = -11
                TitleFont.Name = 'MS Sans Serif'
                TitleFont.Style = []
                UseMultiTitle = True
                VTitleMargin = 5
                OnDrawColumnCell = dbgReferDrawColumnCell
                OnSortMarkingChanged = dbgReferSortMarkingChanged
                Columns = <
                  item
                    EditButtons = <>
                    FieldName = 'ORG_ID'
                    Footers = <>
                    Visible = False
                  end
                  item
                    ButtonStyle = cbsDropDown
                    EditButtons = <>
                    FieldName = 'LORG'
                    Footers = <>
                    Width = 250
                  end>
              end
              object Panel3: TPanel
                Left = 2
                Top = 268
                Width = 514
                Height = 25
                Align = alBottom
                BevelOuter = bvLowered
                TabOrder = 2
                object lcbOrgList: TDBLookupComboboxEh
                  Left = 4
                  Top = 4
                  Width = 250
                  Height = 19
                  AlwaysShowBorder = True
                  DataField = 'ORG_ID'
                  DataSource = dscOrgs
                  DropDownBox.Options = [dlgColumnResizeEh, dlgColLinesEh]
                  DropDownBox.Sizable = True
                  EditButtons = <>
                  Flat = True
                  KeyField = 'ID'
                  ListField = 'SHORTNAME'
                  ListSource = dscOrgList
                  TabOrder = 0
                  Visible = True
                end
              end
            end
            object GroupBox5: TGroupBox
              Left = 0
              Top = 0
              Width = 518
              Height = 184
              Align = alTop
              Caption = ' '#1057#1087#1080#1089#1086#1082' '#1087#1088#1080#1079#1086#1074' '
              TabOrder = 1
              object ToolBar2: TToolBar
                Left = 2
                Top = 15
                Width = 514
                Height = 25
                ButtonWidth = 24
                Caption = 'ToolBar1'
                EdgeBorders = []
                Flat = True
                Images = MAIN.ImageList
                TabOrder = 0
                object ToolButton12: TToolButton
                  Left = 0
                  Top = 0
                  Action = aLotAdd
                end
                object ToolButton13: TToolButton
                  Left = 24
                  Top = 0
                  Action = aLotEdit
                end
                object ToolButton14: TToolButton
                  Left = 48
                  Top = 0
                  Width = 8
                  Caption = 'ToolButton4'
                  ImageIndex = 8
                  Style = tbsSeparator
                end
                object ToolButton19: TToolButton
                  Left = 56
                  Top = 0
                  Action = aLotDelete
                end
                object ToolButton18: TToolButton
                  Left = 80
                  Top = 0
                  Width = 8
                  Caption = 'ToolButton6'
                  ImageIndex = 6
                  Style = tbsSeparator
                end
                object ToolButton15: TToolButton
                  Left = 88
                  Top = 0
                  Action = aLotCommit
                end
                object ToolButton16: TToolButton
                  Left = 112
                  Top = 0
                  Action = aLotRollback
                end
                object ToolButton17: TToolButton
                  Left = 136
                  Top = 0
                  Action = aLotRefresh
                end
              end
              object dbgLots: TDBGridEh
                Left = 2
                Top = 40
                Width = 514
                Height = 142
                Align = alClient
                ColumnDefValues.Title.TitleButton = True
                DataSource = dscLots
                Flat = True
                FooterColor = clWindow
                FooterFont.Charset = DEFAULT_CHARSET
                FooterFont.Color = clWindowText
                FooterFont.Height = -11
                FooterFont.Name = 'MS Sans Serif'
                FooterFont.Style = []
                OddRowColor = clWindow
                Options = [dgEditing, dgTitles, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgAlwaysShowSelection, dgConfirmDelete]
                OptionsEh = [dghFixed3D, dghHighlightFocus, dghClearSelection, dghAutoSortMarking, dghMultiSortMarking, dghDblClickOptimizeColWidth, dghDialogFind]
                SortLocal = True
                TabOrder = 1
                TitleFont.Charset = DEFAULT_CHARSET
                TitleFont.Color = clWindowText
                TitleFont.Height = -11
                TitleFont.Name = 'MS Sans Serif'
                TitleFont.Style = []
                UseMultiTitle = True
                VTitleMargin = 5
                OnDrawColumnCell = dbgReferDrawColumnCell
                OnSortMarkingChanged = dbgReferSortMarkingChanged
                Columns = <
                  item
                    EditButtons = <>
                    FieldName = 'ID'
                    Footers = <>
                  end
                  item
                    EditButtons = <>
                    FieldName = 'NAME'
                    Footers = <>
                  end
                  item
                    EditButtons = <>
                    FieldName = 'RECIEPT'
                    Footers = <>
                  end
                  item
                    EditButtons = <>
                    FieldName = 'IS_ACTIVE'
                    Footers = <>
                    Visible = False
                  end
                  item
                    EditButtons = <>
                    FieldName = 'LOT_ID'
                    Footers = <>
                    Visible = False
                  end
                  item
                    EditButtons = <>
                    FieldName = 'ADDRESS'
                    Footers = <>
                  end
                  item
                    EditButtons = <>
                    FieldName = 'G_LICSCHET'
                    Footers = <>
                  end
                  item
                    EditButtons = <>
                    FieldName = 'CREATEDATE'
                    Footers = <>
                  end
                  item
                    EditButtons = <>
                    FieldName = 'PAY_SUMMA'
                    Footers = <>
                  end>
              end
            end
          end
          object dbnMAX_ABON_CNT: TDBNumberEditEh
            Left = 128
            Top = 200
            Width = 121
            Height = 19
            AlwaysShowBorder = True
            DataField = 'MAX_ABON_CNT'
            DataSource = dscRefer
            EditButton.Style = ebsUpDownEh
            EditButton.Visible = True
            EditButtons = <
              item
                Hint = #1055#1086#1083#1091#1095#1080#1090#1100' '#1089#1090#1072#1090#1080#1089#1090#1080#1082#1091' '#1087#1088#1086#1096#1083#1086#1075#1086' '#1084#1077#1089#1103#1094#1072
                ShortCut = 0
                Style = ebsEllipsisEh
                OnClick = dbnMAX_ABON_CNTEditButtons0Click
              end>
            Flat = True
            Increment = 100.000000000000000000
            MinValue = 1.000000000000000000
            ParentShowHint = False
            ShowHint = True
            TabOrder = 8
            Visible = True
          end
        end
      end
    end
  end
  inherited GroupBox1: TGroupBox
    Height = 0
  end
  inherited shblActionList: TActionList
    Left = 116
    Top = 44
    object aLotAdd: TAction
      Category = 'Lot'
      Caption = #1044#1086#1073#1072#1074#1080#1090#1100' '#1083#1086#1090
      Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1083#1086#1090
      ImageIndex = 9
      OnExecute = aLotAddExecute
    end
    object aLotEdit: TAction
      Category = 'Lot'
      Caption = #1048#1079#1084#1077#1085#1080#1090#1100' '#1083#1086#1090
      ImageIndex = 5
      OnExecute = aLotEditExecute
    end
    object aLotCommit: TAction
      Category = 'Lot'
      Caption = #1055#1086#1076#1090#1074#1077#1088#1076#1080#1090#1100
      Enabled = False
      Hint = #1055#1086#1076#1090#1074#1077#1088#1076#1080#1090#1100' '#1080#1079#1084#1077#1085#1077#1085#1080#1103
      ImageIndex = 0
      OnExecute = aLotCommitExecute
    end
    object aLotRollback: TAction
      Category = 'Lot'
      Caption = #1054#1090#1084#1077#1085#1080#1090#1100
      Enabled = False
      Hint = #1054#1090#1084#1077#1085#1080#1090#1100' '#1080#1079#1084#1077#1085#1077#1085#1080#1103
      ImageIndex = 3
      OnExecute = aLotRollbackExecute
    end
    object aLotRefresh: TAction
      Category = 'Lot'
      Caption = #1054#1073#1085#1086#1074#1080#1090#1100
      Hint = #1054#1073#1085#1086#1074#1080#1090#1100' '#1089#1087#1080#1089#1086#1082
      ImageIndex = 11
      OnExecute = aLotRefreshExecute
    end
    object aLotDelete: TAction
      Category = 'Lot'
      Caption = #1059#1076#1072#1083#1080#1090#1100
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1083#1086#1090
      ImageIndex = 2
      OnExecute = aLotDeleteExecute
    end
    object aOrgAdd: TAction
      Category = 'Orgs'
      Caption = #1044#1086#1073#1072#1074#1080#1090#1100
      Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1086#1088#1075#1072#1085#1080#1079#1072#1094#1080#1102
      ImageIndex = 9
      OnExecute = aOrgAddExecute
    end
    object aOrgDelete: TAction
      Category = 'Orgs'
      Caption = #1059#1076#1072#1083#1080#1090#1100
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1086#1088#1075#1072#1085#1080#1079#1072#1094#1080#1102
      ImageIndex = 2
      OnExecute = aOrgDeleteExecute
    end
    object aOrgCommit: TAction
      Category = 'Orgs'
      Caption = #1055#1086#1076#1090#1074#1077#1088#1076#1080#1090#1100
      Enabled = False
      Hint = #1055#1086#1076#1090#1074#1077#1088#1076#1080#1090#1100' '#1080#1079#1084#1077#1085#1077#1085#1080#1103
      ImageIndex = 0
      OnExecute = aOrgCommitExecute
    end
    object aOrgRollback: TAction
      Category = 'Orgs'
      Caption = #1054#1090#1084#1077#1085#1080#1090#1100
      Enabled = False
      Hint = #1054#1090#1084#1077#1085#1080#1090#1100' '#1080#1079#1084#1077#1085#1077#1085#1080#1103
      ImageIndex = 3
      OnExecute = aOrgRollbackExecute
    end
    object aOrgRefresh: TAction
      Category = 'Orgs'
      Caption = #1054#1073#1085#1086#1074#1080#1090#1100
      Hint = #1054#1073#1085#1086#1074#1080#1090#1100' '#1089#1087#1080#1089#1086#1082
      ImageIndex = 11
      OnExecute = aOrgRefreshExecute
    end
  end
  inherited dsRefer: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE LOT_LIMITS'
      'SET '
      '    MIN_PAY_SUMMA = :MIN_PAY_SUMMA,'
      '    MIN_AFTER_SALDO = :MIN_AFTER_SALDO,'
      '    BDATE = :BDATE,'
      '    EDATE = :EDATE,'
      '    ETIME = :ETIME,'
      '    MAX_ABON_CNT = :MAX_ABON_CNT'
      'WHERE'
      '    LOT_ID = :OLD_LOT_ID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    LOT_LIMITS'
      'WHERE'
      '        LOT_ID = :OLD_LOT_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO LOT_LIMITS('
      '    MIN_PAY_SUMMA,'
      '    MIN_AFTER_SALDO,'
      '    BDATE,'
      '    EDATE,'
      '    ETIME,'
      '    MAX_ABON_CNT'
      ')'
      'VALUES('
      '    :MIN_PAY_SUMMA,'
      '    :MIN_AFTER_SALDO,'
      '    :BDATE,'
      '    :EDATE,'
      '    :ETIME,'
      '    :MAX_ABON_CNT'
      ')'
      'returning lot_id')
    RefreshSQL.Strings = (
      'SELECT'
      '    LOT_ID,'
      '    MIN_PAY_SUMMA,'
      '    MIN_AFTER_SALDO,'
      '    BDATE,'
      '    EDATE,'
      '    ETIME,'
      '    MAX_ABON_CNT'
      'FROM'
      '    LOT_LIMITS '
      ''
      'WHERE '
      '    LOT_LIMITS.LOT_ID = :OLD_LOT_ID'
      '    ')
    SelectSQL.Strings = (
      'SELECT'
      '    LOT_ID,'
      '    MIN_PAY_SUMMA,'
      '    MIN_AFTER_SALDO,'
      '    BDATE,'
      '    EDATE,'
      '    ETIME,'
      '    MAX_ABON_CNT'
      'FROM'
      '    LOT_LIMITS '
      'order by bdate desc, edate desc')
    Transaction = trRead
    Left = 432
    Top = 48
    object dsReferLOT_ID: TFIBIntegerField
      DisplayLabel = #8470' '#1083#1086#1090#1077#1088#1077#1080
      FieldName = 'LOT_ID'
    end
    object dsReferMIN_PAY_SUMMA: TFIBBCDField
      DisplayLabel = #1052#1080#1085#1080#1084#1072#1083#1100#1085#1072#1103' '#1089#1091#1084#1084#1072' '#1087#1083#1072#1090#1077#1078#1072
      FieldName = 'MIN_PAY_SUMMA'
      Size = 2
      RoundByScale = True
    end
    object dsReferMIN_AFTER_SALDO: TFIBBCDField
      DisplayLabel = #1052#1080#1085#1080#1084#1072#1083#1100#1085#1086#1077' '#1089#1072#1083#1100#1076#1086' '#1087#1086#1089#1083#1077' '#1087#1083#1072#1090#1077#1078#1072
      FieldName = 'MIN_AFTER_SALDO'
      Size = 2
      RoundByScale = True
    end
    object dsReferBDATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072' '#1085#1072#1095#1072#1083#1072' '#1083#1086#1090#1077#1088#1077#1080
      FieldName = 'BDATE'
    end
    object dsReferEDATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072' '#1086#1082#1086#1085#1095#1072#1085#1080#1103' '#1083#1086#1090#1077#1088#1077#1080
      FieldName = 'EDATE'
    end
    object dsReferETIME: TFIBTimeField
      DisplayLabel = #1042#1088#1077#1084#1103' '#1086#1082#1086#1085#1095#1072#1085#1080#1103' '#1083#1086#1090#1077#1088#1077#1080
      FieldName = 'ETIME'
    end
    object dsReferMAX_ABON_CNT: TFIBIntegerField
      FieldName = 'MAX_ABON_CNT'
    end
  end
  inherited dscRefer: TDataSource
    Left = 464
    Top = 48
  end
  inherited trRefer: TpFIBTransaction
    Left = 400
    Top = 48
  end
  inherited trLists: TpFIBTransaction
    Left = 588
    Top = 257
  end
  inherited PropStorage: TPropStorageEh
    Section = 'sprLotery'
  end
  object dscLots: TDataSource
    DataSet = dsLots
    Left = 654
    Top = 257
  end
  object dsLots: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE LOT_PRISE'
      'SET '
      '    NAME = :NAME,'
      '    IS_ACTIVE = :IS_ACTIVE'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    LOT_PRISE'
      'WHERE'
      '        ID = :OLD_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO LOT_PRISE('
      '    NAME,'
      '    RECIEPT,'
      '    IS_ACTIVE,'
      '    LOT_ID'
      ')'
      'VALUES('
      '    :NAME,'
      '    :RECIEPT,'
      '    :IS_ACTIVE,'
      '    :LOT_ID'
      ')'
      'returning id')
    RefreshSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME,'
      '    RECIEPT,'
      '    IS_ACTIVE,'
      '    LOT_ID'
      'FROM'
      '    LOT_PRISE '
      'where lot_id = :lot_id'
      '  and LOT_PRISE.ID = :OLD_ID'
      '    ')
    SelectSQL.Strings = (
      'select'
      '    l.id,'
      '    l.name,'
      '    l.reciept,'
      '    l.is_active,'
      '    l.lot_id,'
      '    v.address,'
      '    v.g_licschet,'
      '    r.createdate,'
      '    sum(r.summa) as pay_summa'
      'from'
      '    lot_prise l'
      'left join reciepts r on r.reciept = l.reciept'
      'left join v_abons v on v.id = r.abonent_id'
      'where lot_id = :lot_id'
      'group by 1,2,3,4,5,6,7,8')
    BeforeDelete = dsLotsBeforeInsert
    BeforeEdit = dsLotsBeforeInsert
    BeforeInsert = dsLotsBeforeInsert
    Transaction = trLotWrite
    Database = MAINDM.pMainDatabase
    DataSource = dscRefer
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 622
    Top = 257
    WaitEndMasterScroll = True
    dcForceOpen = True
    object dsLotsID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'ID'
    end
    object dsLotsNAME: TFIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077' '#1083#1086#1090#1072
      DisplayWidth = 30
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsLotsRECIEPT: TFIBStringField
      DisplayLabel = #1042#1099#1080#1075#1088#1072#1074#1096#1080#1081' '#1095#1077#1082
      DisplayWidth = 20
      FieldName = 'RECIEPT'
      Size = 16
      EmptyStrToNull = True
    end
    object dsLotsIS_ACTIVE: TFIBSmallIntField
      DisplayLabel = #1040#1082#1090#1080#1074#1085#1086#1089#1090#1100' '#1083#1086#1090#1072
      DisplayWidth = 20
      FieldName = 'IS_ACTIVE'
    end
    object dsLotsLOT_ID: TFIBIntegerField
      FieldName = 'LOT_ID'
    end
    object dsLotsADDRESS: TFIBStringField
      DisplayLabel = #1040#1076#1088#1077#1089
      DisplayWidth = 30
      FieldName = 'ADDRESS'
      Size = 245
      EmptyStrToNull = True
    end
    object dsLotsG_LICSCHET: TFIBStringField
      DisplayLabel = #8470' '#1051#1057
      DisplayWidth = 16
      FieldName = 'G_LICSCHET'
      EmptyStrToNull = True
    end
    object dsLotsCREATEDATE: TFIBDateField
      DisplayLabel = #1044#1072#1090#1072' '#1087#1083#1072#1090#1077#1078#1072
      FieldName = 'CREATEDATE'
    end
    object dsLotsPAY_SUMMA: TFIBBCDField
      DisplayLabel = #1057#1091#1084#1072' '#1087#1086' '#1095#1077#1082#1091
      FieldName = 'PAY_SUMMA'
      Size = 2
      RoundByScale = True
    end
  end
  object trOrgs: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    CSMonitorSupport.Enabled = csmeDatabaseDriven
    Left = 592
    Top = 402
  end
  object dsOrgs: TpFIBDataSet
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    LOT_ORGS'
      'WHERE ORG_ID = :OLD_ORG_ID'
      '  and LOT_ID = :OLD_LOT_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO LOT_ORGS('
      '    ORG_ID,'
      '    LOT_ID'
      ')'
      'VALUES('
      '    :ORG_ID,'
      '    :LOT_ID'
      ')'
      'returning ORG_ID, LOT_ID')
    RefreshSQL.Strings = (
      'SELECT'
      '    ORG_ID,'
      '    LOT_ID'
      'FROM'
      '    LOT_ORGS '
      'where LOT_ORGS.ORG_ID = :OLD_ORG_ID'
      '  and LOT_ORGS.LOT_ID = :OLD_LOT_ID    ')
    SelectSQL.Strings = (
      'SELECT'
      '    ORG_ID,'
      '    LOT_ID'
      'FROM'
      '    LOT_ORGS '
      'where lot_id = :lot_id')
    BeforeDelete = dsOrgsBeforeInsert
    BeforeInsert = dsOrgsBeforeInsert
    Transaction = trOrgs
    Database = MAINDM.pMainDatabase
    UpdateTransaction = trOrgsWrite
    DataSource = dscRefer
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 626
    Top = 402
    WaitEndMasterScroll = True
    dcForceOpen = True
    object dsOrgsORG_ID: TFIBIntegerField
      Alignment = taLeftJustify
      DisplayLabel = #1054#1088#1075#1072#1085#1080#1079#1072#1094#1080#1103
      FieldName = 'ORG_ID'
      Required = True
    end
    object dsOrgsLOT_ID: TFIBIntegerField
      FieldName = 'LOT_ID'
    end
    object dsOrgsLORG: TStringField
      DisplayLabel = #1054#1088#1075#1072#1085#1080#1079#1072#1094#1080#1103
      FieldKind = fkLookup
      FieldName = 'LORG'
      LookupDataSet = dsOrgList
      LookupKeyFields = 'ID'
      LookupResultField = 'SHORTNAME'
      KeyFields = 'ORG_ID'
      Lookup = True
    end
  end
  object dscOrgs: TDataSource
    DataSet = dsOrgs
    Left = 658
    Top = 402
  end
  object trRead: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    CSMonitorSupport.Enabled = csmeDatabaseDriven
    Left = 400
    Top = 80
  end
  object dsOrgList: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    SHORTNAME'
      'FROM'
      '    USERORG uo'
      
        'where exists (select 1 from username u where u.orgcode = uo.id a' +
        'nd u.groupcode in (4,8))'
      'order by 2')
    Transaction = trRead
    Database = MAINDM.pMainDatabase
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 626
    Top = 434
    object dsOrgListID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsOrgListSHORTNAME: TFIBStringField
      FieldName = 'SHORTNAME'
      Size = 30
      EmptyStrToNull = True
    end
  end
  object dscOrgList: TDataSource
    DataSet = dsOrgList
    Left = 658
    Top = 434
  end
  object trLotWrite: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    CSMonitorSupport.Enabled = csmeDatabaseDriven
    AfterEnd = trLotWriteAfterEnd
    Left = 588
    Top = 285
  end
  object trOrgsWrite: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    CSMonitorSupport.Enabled = csmeDatabaseDriven
    AfterEnd = trOrgsWriteAfterEnd
    Left = 592
    Top = 434
  end
  object dsMonthPays: TpFIBDataSet
    SelectSQL.Strings = (
      'select count(distinct r.abonent_id) as abon_count'
      '      from lot_limits ll'
      '      join lot_orgs lo on ll.lot_id = lo.lot_id'
      '      join username un on lo.org_id = un.orgcode'
      '      join reciepts r on un.id = r.createuserid'
      
        '           and r.createdate between incdate(:pbdate, 0, -1, 0) a' +
        'nd incdate(:pedate, 0, -1, 0)')
    BeforeDelete = dsOrgsBeforeInsert
    BeforeInsert = dsOrgsBeforeInsert
    Transaction = trOrgs
    Database = MAINDM.pMainDatabase
    UpdateTransaction = trOrgsWrite
    DataSource = dscRefer
    CSMonitorSupport.Enabled = csmeTransactionDriven
    Left = 142
    Top = 334
    WaitEndMasterScroll = True
    dcForceOpen = True
    object dsMonthPaysABON_COUNT: TFIBIntegerField
      FieldName = 'ABON_COUNT'
    end
  end
end
